import React from "react";
import routeWithUserSession from "@/components/ApplicationArea/routeWithUserSession";
import PageHeader from "@/components/PageHeader";
import Toolbar from "@/components/workflow/Toolbar";
import routes from "@/services/routes";
class WorkFlowNew extends React.Component {

  state = {
    items:[],
       id: "0",
    loading: true,
  };
  componentWillMount() {
    let id;
    if(this.props.id===undefined){
      id=0;
    }else{
      id=this.props.id;
    }
      this.setState({
            id: id,
            loading: false,
      });
  }

  render() {
    if (this.state.loading ) return null;
    return (
      <div className="settings-screen">
        <div className="container">
          <PageHeader title="审批流程" />
            <div className="p-15">
              <Toolbar  id={this.state.id} />
            </div>
        </div>
      </div>
    );
  }
}
routes.register(
  "Workflow.New",
  routeWithUserSession({
    path: "/workflow/new/:id",
    title: "审批流程",
    render: pageProps => <WorkFlowNew {...pageProps}/>,
  })
);
